from scrapy.commands import ScrapyCommand  
from scrapy.utils.project import get_project_settings  
from scrapy.crawler import Crawler  
  
class Command(ScrapyCommand):  
  
    def run(self, args, opts):  
        settings = get_project_settings()  
        spider_loader = self.crawler_process.spider_loader
        for spider_name in args or spider_loader.list():
            print("*********************" + spider_name + "正在爬取*********************")
            self.crawler_process.crawl(spider_name)

        self.crawler_process.start()